﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;

namespace IRCBot.Helpers
{
    public class HTMLHelper
    {
        public static string GetHtmlFromUrl(string url, string username, string password)
        {
            WebClient client = new WebClient();
            if (username != null && password != null)
                client.Credentials = new NetworkCredential(username, password);
            Stream data = client.OpenRead(url);

            StreamReader reader = new StreamReader(data);
            string str = "";
            str = reader.ReadToEnd();
            data.Close();

            return str;
        }
    }
}
